﻿using Microsoft.SharePoint;
using NUnit.Framework;

namespace PS.Practices.Provisioner.Test
{
    [TestFixture]
    public class ActivationTests
    {
 /*
        [Test]
        public void LocateApplicableScript()
        {
            using(var site = new SPSite("http://dboucher-laptop/Test"))
            {
                using(var web = site.OpenWeb())
                {
                    var locatedScript = EventSink.LocateScript(web);
                    Assert.AreEqual("<Provisioner />",  locatedScript);
                }
            }
        }
*/
        [Test]
        public void ValidateProvisioner()
        {
            string sUrl = "http://dboucher-laptop";
            using (SPSite site = new SPSite(sUrl))
            {
                using(SPWeb web = site.OpenWeb())
                {
                    /* Test that the subwebs were successfully created */
                    SPWebCollection webObjects = web.Webs;

                    Assert.True(webObjects[0].Name == "subweb1");
                    Assert.True(webObjects[1].Name == "subweb2");
                }
            }
        }
    }
}
